home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-08 | 2.8 KB | 102 lines | [TEXT/MPS ] |
- ## VUMark - a script by Nick Vaccaro designed to mark tasks in VU scripts.
- ##
- ## Usage: To use VUMark, just put this script into the MPW Scripts folder (or somewhere
- ## where MPW can find it) and type the following line from the worksheet:
- ##
- ## VUMark theScriptName
- ##
- ## where theScriptName is the name (and path, if not in current directory) of
- ## the VU script to be marked. If you do not wish the file to be closed after
- ## being marked, use the following syntax:
- ##
- ## VUMark -nc theScriptName
- ##
- ## Examples - VUMark -nc myScript.vu
- ## VUMark myScript.vu
- ##
- ## 10/5/90 - created version 1.0a1
- ## 10/6/90 - Now ignores case and will find task names with _ in them. Any other characters
- ## that need to be included, please let me know. - Nick x44278
- ## 04/11/93 - ∂r changed to ∂n in task search - SBR
- ## 05/21/93 - script object mark added for VU 2.x scripts - SBR
- ## 05/21/93 - returns marked script to the front - SBR
- ##
- set Version "1.0b1"
- set exit 0
-
- if ({#} == 0)
- echo
- echo "## {0} Version {Version} - by Nick Vaccaro"
- echo "##"
- echo "## Desc. - {0} will search the requested file for the literal string ∂"Task∂" at"
- echo "## the beginning of a line and will mark that location with the task name "
- echo "## (the word following the task string). When all the tasks are marked, "
- echo "## {0} will search the requested file for the literal string ∂"Script∂" "
- echo "## and mark that location with ••{scriptName}••. Once the marking is done, "
- echo "## the file is saved. If the -nc parameter is not present, the file is closed, "
- echo "## otherwise it is returned to the front. "
- echo "## Usage:"
- echo "## {0} [-nc] ∂"vuScriptName∂""
- echo "##"
- echo "## -nc - Optional parameter - if present, VUMark will not close (nc)"
- echo "## the script after marking it."
- echo "## vuScriptName - The name of the VU script to be marked"
- echo "##"
- echo "## Example:"
- echo "## {0} ∂"myScript.vu∂""
- echo "## {0} -nc ∂"myScript.vu∂""
- echo "##"
- exit 1
- end
-
-
- Set CloseFile 1
- if "{1}" =~ /-nc/
- set CloseFile 0
- Target "{2}"
- else
- Target "{1}"
- end
-
- Set oldWrap {SearchWrap}
- Set SearchWrap 0
- Set oldType {SearchType}
- Set SearchType 0
- Set oldBack {SearchBackward}
- Set SearchBackward 0
- Set oldCase {CaseSensitive}
- Set CaseSensitive 0
-
- Find • "{Target}"
-
- loop
- Find /•task[ ∂n∂t]*/ "{Target}"
- Break if {status} == 2
- Find /[A-Za-z_0-9]+/ "{Target}"
- Set tempName "`Catenate "{Target}".§`";
- Mark -y § "{tempName}" "{Target}"
- End
-
- Find • "{Target}"
-
- loop
- Find /•script[ ∂n∂t]*/ "{Target}"
- Break if {status} == 2
- Find /[A-Za-z_0-9]+/ "{Target}"
- Set tempName "`Catenate "{Target}".§`";
- Mark -y § "••{tempName}••" "{Target}"
- End
-
- Save "{Target}"
-
- if {CloseFile}
- Close "{Target}"
- else
- Open "{target}"
- end
-
- Set SearchWrap {oldWrap}
- Set SearchType {oldType}
- Set SearchBackward {oldBack}
- Set CaseSensitive {oldCase}
-